package Filter;

import java.util.List;

public class AndCriteria implements Criteria {
    private  Criteria criteria;
    private Criteria secondCriteria;
    public  AndCriteria(Criteria criteria,Criteria criteria2) {
        this.criteria =criteria;
        this.secondCriteria=criteria2;
    }
    @Override
    public List<Person> meetCriteria(List<Person> persons) {
        List<Person> personList=criteria.meetCriteria(persons);
        return secondCriteria.meetCriteria(personList);
    }
}
